// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from 'vue'
import App from './App'
import router from './router'
import Header from './components/Header'
import Footer from './components/Footer'
import LeftNavigation from './components/LeftNavigation'
import SidebarControl from './components/SidebarControl'
import Content from './components/Content'

import './lib/jquery-vender.js'
// 引入bootStrap  在 node_modules中
import 'bootstrap'
import 'bootstrap/dist/css/bootstrap.css'
// 引入font-awesome
import 'font-awesome/css/font-awesome.css'

// 引用admin-tle
import 'admin-lte'
import 'admin-lte/dist/css/AdminLTE.min.css'
import 'admin-lte/dist/css/skins/_all-skins.min.css'
// import 'admin-lte/dist/js/adminlte.min.js'

Vue.config.productionTip = false
// Vue.http.options.emulateJSON = true

Vue.component('Header', Header)
Vue.component('Footer', Footer)
Vue.component('LeftNavigation', LeftNavigation)
Vue.component('SidebarControl', SidebarControl)
Vue.component('Content', Content)

/* eslint-disable no-new */
new Vue({
  el: '#app',
  router,
  components: { App },
  template: '<App/>'
})

// new Vue({
//   el: '#app',
//   router,
//   render: h => h(Main),
//   created () {
//     this.checkLogin()
//   },
//   methods: {
//     checkLogin () {
//       if (!this.getCookie('user-info')) {
//         this.$router.push('/login')
//       } else {
//         this.$router.push('/main')
//       }
//     }
//   }
// })
